using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Common.Shared.Xml.Wddx {
	/// <summary>
	/// Represents an Exception with the WddxDocument
	/// </summary>
	public class WddxException : XmlException {
		public WddxException ( )
			: this ( "An Unhandled WDDX Exception Occurred." ) {
		}

		public WddxException ( string message )
			: base ( message ) {
		}

		public WddxException ( string message, Exception innerException, int lineNumber, int linePosition )
			: base ( message, innerException, lineNumber, linePosition ) {
		}

		public WddxException ( string message, Exception innerException )
			: base ( message, innerException ) {
		}
	}

	/// <summary>
	/// Represents a WddxRequiredAttrubuteMissingException
	/// </summary>
	public class WddxRequiredAttributeMissingException : WddxException {
		public WddxRequiredAttributeMissingException ( )
			: base ( "A required Attribute was not found in the Element" ) {
		}

		public WddxRequiredAttributeMissingException ( string attributeName )
			: base ( "A required Attribute (" + attributeName + " was not found in the Element" ) {
		}
	}

	public class WddxInvalidObjectTypeException : WddxException {
		public WddxInvalidObjectTypeException ( )
			: base ( "The WddxElement does not support the type of object" ) {

		}

		public WddxInvalidObjectTypeException ( Type passed, Type expected )
			: base ( "The WddxElement was expecting a " + expected.ToString ( ) + ". A " + passed.ToString ( ) + " was passed and is not supported." ) {

		}
	}
}
